#ifndef __CGAMEVIEW_H__
#define __CGAMEVIEW_H__

#include "cocos2d.h"
#include "CGrid.h"
#include <vector>

USING_NS_CC;

#define NUM_ROWS 13
#define NUM_COLS 9

class CGameView : public CCLayer
{
public:
	virtual ~CGameView();

	CREATE_FUNC(CGameView);
	virtual bool init();

private:
	CGameView();

	EventListenerTouchOneByOne* listener;

	CCSprite* background;
	CCSprite* container;

	CGrid* allGrids[NUM_COLS][NUM_ROWS];
	std::vector<CGrid*> dropGrids;
	std::vector<CGrid*> selectedGrids;

	void generateRandomGrids();
	void clearSelected();
	void findGrids(CGrid* grid, GridType type);
	void highLightSelected();
};

#endif